package ink.ykb.demo.config;

import java.io.Serializable;

/**
 * 全局响应公共类
 * @author mading
 *
 */
public class ResponseMsg<T> implements Serializable{

  private static final long serialVersionUID = 1L;

  private String code;

  private String msg;

  private T body;

  public boolean isOk() {
    return CodeConstant.SUCCESS.equals(code);
  }
  
  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public T getBody() {
    return body;
  }
  
  public void setBody(T body) {
    this.body = body;
  }

  public ResponseMsg(String code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  public ResponseMsg(String code, String msg, T body) {
    super();
    this.code = code;
    this.msg = msg;
    this.body = body;
  }
  
  public ResponseMsg() {
	  
  }
}
